package day03;

import java.util.Arrays;

public class Array {

	public static void main(String[] args) {
		//数组定义方式1
		String a[];
		//数组定义方式2
		String[] b;
		String[] d,f,g;
		a= new String[5];
		//arrays方法打印
		System.out.println(Arrays.toString(a));
		int[ ]w =new int[5];
		w[0]=2;
		//for普通循环遍历
		for (int i = 0; i < w.length; i++) {
			System.out.println(w[0]);
		}
		//增强for foreach
		for (String string :a) {
			System.out.println(a);
		}
		//数组赋值
		int[ ]u;
		u=new int[]{0,1,2};
		//或者
		int[] o= {2,5,4};
		
		
		//o= {5,4,8};
		
		//数组拷贝
		String a1[] = {"w","e","e"};
		String a2[]=new String[5];
		//a1,0a1的复制起始点  a2,0a2的复制起始点 ，复制的长度
		System.arraycopy(a1, 0, a2, 0, 3);
		System.out.println(a2);
		System.out.println(Arrays.toString(a2));
		String[] names = new String []{"jack","rose"};

	}

	
}
